var express = require("express")
// 加载模板
const swig = require('swig');
var app = express()
app.use("/public", express.static(__dirname + "/public"))


app.engine('html', swig.renderFile)
app.set('views', './view')
app.set('view engine', 'html')
swig.setDefaults({
    cache: false
})

// 按照功能划分不同模块
app.use('/', require('./routers/main'))
// app.use('/api',require('./routers/api'))
// app.use('/admin',require('./routers/admin'))

// 监听8080端口
var port = 8080;
app.listen(port, () => {
    console.log(`http://127.0.0.1:${+ port}`)
})

